{include file="../application/mobile/view/header.html" /}
</head>
<body>

	<div class="bui-page">
	    <header class="bui-bar">
	        <div class="bui-bar-left">
	            <a class="bui-btn" href="/index.php/mobile/index/index"><i class="icon-back"></i></a>
	        </div>
	        <div class="bui-bar-main">我</div>
	        <div class="bui-bar-right">
	            <!-- 右边按钮位置 -->
	        </div>
	    </header>
	    <main>
	        <!-- 正文内容 -->
	        <ul class="bui-list">
	        {if condition="$iflogin eq 'never'"}
	        <li class="bui-btn bui-box" href="login_view">
                <div class="bui-icon primary"><i class="icon-people">&#xe67b;</i></div>
                <div class="span1">登录</div>
                <i class="icon-listright"></i>
            </li>
            {else/}
            
           <!--  <li class="bui-btn bui-box" href="user_set">
                <div class="bui-icon success"><i class="icon-home"></i></div>
                <div class="span1">设置</div>
                <i class="icon-listright"></i>
            </li> -->
           <!--  <li class="bui-btn bui-box">
                <div class="bui-icon primary"><i class="icon-alert"></i></div>
                <div class="span1">未读消息 <span class="bui-badges">5</span></div>
                <i class="icon-listright"></i>
            </li> -->
            <li class="bui-btn bui-box" id="logout">
                <div class="bui-icon danger"><i class="icon-guanbi2">&#xe61c;</i></div>
                <div class="span1">退出</div>
            </li>
           {/if} 
        </ul>
	    </main>
	    <footer>
	        <!-- 底部内容 此处内容固定在页面底部 -->
	    </footer>
	</div>

{include file="../application/mobile/view/footer.html" /}
<script>
        bui.ready(function () {
            // 控件初始化

            $('body').on('click','#logout',function(){

            	bui.confirm("您确定要退出系统吗？",function(e){
            	    
            	    var text = $(e.target).text();
            	    if( text == "确定" ){
            	    	//do something
            	    	bui.ajax({
		            	    url: "logout",
		            	    data: {},//接口请求的参数
		            	    // 可选参数
		            	    method: "GET"
		            	}).then(function(result){
		            	    // 成功
		            	    if (result.err == '0') {
		            	    	bui.hint({ appendTo:"main", content:"<i class='icon-infofill'></i>"+result.content, position:"top" , skin:'success', showClose:true, autoClose: false});
		            	    	bui.refresh();
		            	    }else{
		            	    	bui.hint({ appendTo:"main", content:"<i class='icon-infofill'></i>"+result.content, position:"top" , skin:'danger', showClose:true, autoClose: false});
		            	    }
		            	    
		            	},function(result,status){
		            	    // 失败 
		            	    bui.hint({ appendTo:"main", content:"<i class='icon-infofill'></i>"+result.content, position:"top" , skin:'danger', showClose:true, autoClose: false});
		            	});
            	    }
            		this.close();
            	});

            	
            });
           
    
        });
        bui.btn({id:".bui-page",handle:".bui-btn,a"}).load();
    </script>
</body>
</html>